package com.itheima.es.controller;
import com.itheima.es.entity.Result;
import com.itheima.es.pojo.Sku;
import com.itheima.es.service.SkuService;
import io.swagger.annotations.Api;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@Api(tags = "查询模块管理")
public class WebController {
    @Reference
    private SkuService skuService;

//    public Result findAll(){
//        List<Sku> skuList = skuService.findAll();
//        System.out.println(skuList);
//        return  new Result(skuList);
//    }

//    @Reference
//    private SkuService skuService;
//
//    @PostMapping("sku/findPage")
//    @ApiOperation(value = "分页查询",notes = "根据客户端请求，完成分页查询")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name="currentPage",value="当前分页页码",required=true,paramType="form",dataType="Integer"),
//            @ApiImplicitParam(name="pageSize",value="每页显示记录数",required=true,paramType="form",dataType="Integer"),
//            @ApiImplicitParam(name="queryString",value="查询条件",required=false,paramType="form",dataType="String")
//    })
//    public Result findPage(@RequestBody QueryPageBean queryPageBean){
//        //System.out.println(queryPageBean);
//        //将分页得到的数据放到Result中
//        return new Result(skuService.findPage(queryPageBean));
//    }
}
